{% extends "buyer/base.html" %}

{% load static %}

{% block content %}
    <div class="goods_detail_con clearfix">
		<div class="goods_detail_pic fl"><img src="/static/{{ commodity.commodity_picture }}"></div>

		<div class="goods_detail_list fr">
			<h3>{{ commodity.commodity_name }}</h3>
			<p>{{ commodity.commodity_content }}</p>
			<div class="prize_bar">
				<span class="show_pirze">¥<em>{{ commodity.commodity_price }}</em></span>
				<span class="show_unit">单  位：500g</span>
			</div>
            <form method="post">
            {% csrf_token %}
			<div class="goods_num clearfix">
				<div class="num_name fl">数 量：</div>
				<div class="num_add fl">
					<input id="number" name="number" type="text" class="num_show fl" value="1">
{#					<input id="com_id" name="com_id" type="hidden" value="{{ commodity.id }}">#}
                    <a href="javascript:hello('add');" class="add fr">+</a>
					<a href="javascript:hello('minus');" class="minus fr">-</a>
{#                    <a href="#" class="minus fr">-</a>#}
{#                    <a href="javascript:;" class="minus fr">-</a>#}
{#                    <a href="javascript:void(0);" class="minus fr">-</a>#}
				</div>
			</div>
			<div class="total">总价：<em id="total">16.80元</em></div>
			<div class="operate_btn">
				<button type="submit" class="buy_btn">立即购买</button>
				<a href="javascript:;" class="add_cart" id="add_cart">加入购物车</a>
			</div>
            </form>
		</div>
	</div>
	<div class="main_wrap clearfix">
		<div class="l_wrap fl clearfix">
			<div class="new_goods">
				<h3>新品推荐</h3>
				<ul>
					<li>
						<a href="#"><img src="images/goods/goods001.jpg"></a>
						<h4><a href="#">进口柠檬</a></h4>
						<div class="prize">￥3.90</div>
					</li>
					<li>
						<a href="#"><img src="images/goods/goods002.jpg"></a>
						<h4><a href="#">玫瑰香葡萄</a></h4>
						<div class="prize">￥16.80</div>
					</li>
				</ul>
			</div>
		</div>

		<div class="r_wrap fr clearfix">
			<ul class="detail_tab clearfix">
				<li class="active">商品介绍</li>
				<li>评论</li>
			</ul>

			<div class="tab_content">
				<dl>
					<dt>商品详情：</dt>
					<dd>草莓采摘园位于北京大兴区 庞各庄镇四各庄村 ，每年1月-6月面向北京以及周围城市提供新鲜草莓采摘和精品礼盒装草莓，草莓品种多样丰富，个大香甜。所有草莓均严格按照有机标准培育，不使用任何化肥和农药。草莓在采摘期间免洗可以直接食用。欢迎喜欢草莓的市民前来采摘，也欢迎各大单位选购精品有机草莓礼盒，有机草莓礼盒是亲朋馈赠、福利送礼的最佳选择。 </dd>
				</dl>
			</div>

		</div>
	</div>
{% endblock %}
{% block script %}
<script>
    function hello(method) {
        var value = $("#number").val();
        if(method == "add"){
            value++
        }else if(method == "minus" && value > 1){
            value--
        }else {
            value = 1
        }

        $("#number").val(value);
    }
</script>
{% endblock %}